
const path = require('path');
const fsExtra = require('fs-extra');
const fs = require('fs')
const outPath = path.resolve('./nuxt_muban/')
const copyDir = async () => {
    try {
        // await removeDirExcept('./nect_echart_dist', ['src'])
        await fsExtra.emptyDir(outPath);
        await fsExtra.remove(path.resolve('./.output/server/node_modules'))
        // // 使用 fs-extra 的 copy 方法来复制目录
        await fsExtra.copy(path.resolve('./.output/'), path.resolve(outPath));
        await fsExtra.copyFile(path.resolve('./ecosystem.config.js'), path.resolve(outPath, './ecosystem.config.js'));
    } catch (error) {
        console.error('Error copying directory:', error);
    }
}

copyDir()